package com.cloud.observer;

import com.cloud.observer.handler.IExceptionHandler;
import com.cloud.observer.handler.IExecuteHandler;
import com.cloud.observer.handler.successHandler.ISuccessHandler;
import lombok.Data;

import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @author: create by God of SJF
 * @version: v1.0
 * @description: com.cloud.observer
 * @date:2021/1/12
 */
@Data
public class ScheduledInfo {
    String name;//定时任务key
    String corn;//表达式
    Integer successNum;//成功次数
    Integer delayNum;//延迟次数
    Integer delayNumLimit;//延迟次数上限
    Integer delayLimitTime;//延迟时间上限
    List<IExecuteHandler> executeHandlerList;//执行延时处理接口
    List<IExceptionHandler> exceptionHandlerList;//报错处理接口
    List<ISuccessHandler> successHandlerList;//成功处理接口
    Date lastBegin;//上次执行开始时间
    Date lastEnd;//上次执行结束时间
    Boolean errorSend;//是否发送错误警告
    Boolean successSend;//是否发送成功提示
    Exception exception;//抱错信息
    ScheduledExecutorService pool = new ScheduledThreadPoolExecutor(1);
    TimeUnit timeUnit = TimeUnit.SECONDS;
    Set<String> errorSet = new HashSet<>();
    ScheduledExecutorService clean = new ScheduledThreadPoolExecutor(1);
    String edition ;
    Integer exceptionFlag =0;
    String remark;
    Integer init = 1;
}
